/*
** pud_state.c for pud in mrcellophane/libpud/sys/NetBSD
** 
** Made by solomon hykes
** Login   <torgau@gmail.com>
** 
** Started on  Sun Jun  5 01:31:44 2005 solomon hykes
** Last update Sun Jun  5 02:31:20 2005 solomon hykes
*/

#include <string.h>
#include "pud_sys.h"

pud_process	*pud_dup(pud_process *p)
{
  sys_pud_process	*proc = (sys_pud_process *)p;
  sys_pud_process	*procSave;

  procSave = malloc(sizeof(*procSave));
  memcpy(procSave, proc, sizeof(*proc));
  return ((pud_process *)procSave);
}


void		pud_release(pud_process *p)
{
  free(p);
}

t_ret		pud_set_state(pud_process *p, pud_process *s)
{
  sys_pud_process	*proc = (sys_pud_process *)p;
  sys_pud_process	*state = (sys_pud_process *)s;

  /* Copy registers */
  memcpy(&proc->regs, &state->regs, sizeof(proc->regs));
  sys_pud_setregs(proc);
  return (ret_ok);
}
